export class ChartModel {
  static getTemperatureList() {
    return Array.from({ length: 7 }, () => +(Math.random() * 8 + 18).toFixed(1));
  }

  static highLightData(data, threshold) {
    let color: string = '#fffa2253'
    //进来一个列表 判断有没有超过预设的值
    return data.map(value =>
    value > threshold ? { color, value } : value
    );
  }

  //返回格式化的字符串
  static generateDateList() {
    const now = new Date();
    return Array.from({ length: 7 }, (_, i) => {
      let date = new Date(now.getTime() + i * 5 * 1000);
      return date.toTimeString().slice(0, 8)
    }
    );
  }





}

